//基本类型
export type BaseType=null|undefined|boolean|number|string|((...args:any[]) => unknown)|bigint|symbol;
//普通对象
export interface PlainObject<T=unknown>{
	[key:string]:T|PlainObject<T>|PlainArray<T>;
}
//普通数组
export type PlainArray<T=unknown>=Array<T|PlainArray<T>|PlainObject<T>>;
//region copy, extend方法相关类型
export type CopyParamDest=PlainObject|PlainArray;
export type CopyParamSrc<T,E>=T extends PlainArray?PlainArray|E:PlainObject;
//endregion
//region getConverter方法
export type GetConverterReturn<P>=P extends boolean
	?(p:unknown) => boolean
	:(P extends number
		?(p:unknown) => number
		:(P extends string
			?(p:unknown) => string
			:(p:unknown) => unknown
			)
		);
//endregion
//region defaultTemplate方法
export interface DefaultTemplateOption{
	//Object的通用模板键
	allTemplateKey?:string;
}
export interface InnerDefaultTemplateOption{
	objectFn:(def:any,src:any,opt:InnerDefaultTemplateOption) => any;
}
export interface TemplateNewKeyFn{
	(oldKey:string):string;
}
//endregion
//region getCalcColumnWidthFn方法
export interface WidthObject{
	width?:number|string;
	minWidth?:number;
	maxWidth?:number;
}
export type WidthDescribe=number|string|WidthObject;
export type WidthLimitType=false|'min'|'max';
export interface widthFn{
	(allWidth:number,frwidth:number):number;
}
export interface StringInfoObject{
	hasFr:false;
	minWidth:number;
	maxWidth?:number;
	expr:widthFn;
	width:widthFn;
}
export interface FrInfoObject {
	hasFr:true;
	limit:WidthLimitType;
	count:number;
	index:number;
	minWidth:number;
	maxWidth?:number;
	lastFixWidth?:number;
	initFixWidth?:number;
	expr:widthFn;
	width:widthFn;
}
export type InfoObject=StringInfoObject|FrInfoObject;
export interface CalcColumnWidthFn{
	(width:number):Array<number>;
}
//endregion
//region loopTree方法
export interface TreeNodeWrap{
	node:any;
	parent:TreeNodeWrap|undefined;
}
export interface TreeNodeCallbackState{
	skip?:boolean;
	stop?:boolean;
	remove?:boolean;
}
export interface TreeNodeCallback{
	(nodeWrap:TreeNodeWrap):TreeNodeCallbackState|boolean|void;
}
//endregion
//region debounce方法
export interface DebounceOption{
	leading?:boolean;
	trailing?:boolean;
	maxWait?:number;
}
export interface DebounceExtraProp<T extends((...args:any[]) => unknown)>{
	cancel:() => void;
	pending:() => boolean;
	flush:() => ReturnType<T>;
}
//endregion
//region throttle方法
export interface ThrottleOption{
	leading?:boolean;
	trailing?:boolean;
}
//endregion
//region insertionSort方法
export interface CompareFn<T>{
	(a:T,b:T):number;
}
//endregion